package com.pb.infra.auth.controller;

import com.pb.infra.oth.entity.common.Page;
import com.pb.infra.oth.entity.common.Result;
import com.pb.infra.auth.service.SysOptLogService;
import com.pb.infra.oth.util.Constant;
import com.pb.infra.oth.util.SysLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 操作日志管理
 *
 * @Author:liudebao
 * @Date: 2019/10/21
 */
@Slf4j
@RestController
@RequestMapping("v1/SysOptLog")
public class SysOptLogController {

    /**
     * 业务逻辑对象
     */
    @Resource
    private SysOptLogService logService;

    /**
     * 查询日志列表
     *
     * @param logParam 请求参数
     * @return Result 返回数据
     */
    @GetMapping("select")
    public Result select(@RequestParam Map<String, Object> logParam, Page page) {
        log.info("SysOptLog/select 查询日志列表 》》请求参数：{}", logParam);
        return logService.select(logParam, page);
    }

    /**
     * 查询日志操作类型
     *
     * @return Result 返回数据
     */
    @GetMapping("selectType")
    public Result selectType() {
        log.info("SysOptLog/selectType 查询日志操作类型");
        return logService.selectType();
    }

}
